<?php

/**
 * This is the model class for table "sakpa_t_spmbmn".
 *
 * The followings are the available columns in table 'sakpa_t_spmbmn':
 * @property string $THNANG
 * @property string $KDBAES1
 * @property string $KDWILAYAH
 * @property string $KDSATKER
 * @property string $KDDEKON
 * @property string $PERASET
 * @property string $Ksakpa_d_PERK
 * @property string $RPH
 * @property string $TGL_BUKU
 * @property string $JNS_TRN
 * @property string $TGL_SP2D
 * @property string $NO_SP2D
 * @property string $BKPK
 * @property string $TGLKIRIM
 * @property string $PERIODE
 * @property string $KDBAPEL
 * @property string $KDES1PEL
 * @property string $KDBLU
 * @property string $KDKPPN
 */
class SakpaTSp extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return SakpaTSp the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sakpa_t_spmbmn';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('THNANG, KDWILAYAH', 'length', 'max'=>4),
			array('KDBAES1', 'length', 'max'=>5),
			array('KDSATKER, Ksakpa_d_PERK, BKPK', 'length', 'max'=>6),
			array('KDDEKON, PERASET, PERIODE, KDES1PEL', 'length', 'max'=>2),
			array('RPH', 'length', 'max'=>19),
			array('JNS_TRN, KDBAPEL, KDKPPN', 'length', 'max'=>3),
			array('NO_SP2D', 'length', 'max'=>7),
			array('TGLKIRIM', 'length', 'max'=>10),
			array('KDBLU', 'length', 'max'=>1),
			array('TGL_BUKU, TGL_SP2D', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('THNANG, KDBAES1, KDWILAYAH, KDSATKER, KDDEKON, PERASET, Ksakpa_d_PERK, RPH, TGL_BUKU, JNS_TRN, TGL_SP2D, NO_SP2D, BKPK, TGLKIRIM, PERIODE, KDBAPEL, KDES1PEL, KDBLU, KDKPPN', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'THNANG' => 'Thnang',
			'KDBAES1' => 'Kdbaes1',
			'KDWILAYAH' => 'Kdwilayah',
			'KDSATKER' => 'Kdsatker',
			'KDDEKON' => 'Kddekon',
			'PERASET' => 'Peraset',
			'Ksakpa_d_PERK' => 'Ksakpa D Perk',
			'RPH' => 'Rph',
			'TGL_BUKU' => 'Tgl Buku',
			'JNS_TRN' => 'Jns Trn',
			'TGL_SP2D' => 'Tgl Sp2 D',
			'NO_SP2D' => 'No Sp2 D',
			'BKPK' => 'Bkpk',
			'TGLKIRIM' => 'Tglkirim',
			'PERIODE' => 'Periode',
			'KDBAPEL' => 'Kdbapel',
			'KDES1PEL' => 'Kdes1 Pel',
			'KDBLU' => 'Kdblu',
			'KDKPPN' => 'Kdkppn',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('THNANG',$this->THNANG,true);
		$criteria->compare('KDBAES1',$this->KDBAES1,true);
		$criteria->compare('KDWILAYAH',$this->KDWILAYAH,true);
		$criteria->compare('KDSATKER',$this->KDSATKER,true);
		$criteria->compare('KDDEKON',$this->KDDEKON,true);
		$criteria->compare('PERASET',$this->PERASET,true);
		$criteria->compare('Ksakpa_d_PERK',$this->Ksakpa_d_PERK,true);
		$criteria->compare('RPH',$this->RPH,true);
		$criteria->compare('TGL_BUKU',$this->TGL_BUKU,true);
		$criteria->compare('JNS_TRN',$this->JNS_TRN,true);
		$criteria->compare('TGL_SP2D',$this->TGL_SP2D,true);
		$criteria->compare('NO_SP2D',$this->NO_SP2D,true);
		$criteria->compare('BKPK',$this->BKPK,true);
		$criteria->compare('TGLKIRIM',$this->TGLKIRIM,true);
		$criteria->compare('PERIODE',$this->PERIODE,true);
		$criteria->compare('KDBAPEL',$this->KDBAPEL,true);
		$criteria->compare('KDES1PEL',$this->KDES1PEL,true);
		$criteria->compare('KDBLU',$this->KDBLU,true);
		$criteria->compare('KDKPPN',$this->KDKPPN,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}